package vk.tati.tresenraya;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;

public class MainActivityTres extends Activity implements OnClickListener{

	RadioButton vsOtro;
	RadioButton vsCPU;
	Button jugar;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main_activity_tres);
		
		//Vistas
		vsOtro = (RadioButton) findViewById(R.id.vsOtro);
		vsCPU = (RadioButton) findViewById(R.id.vsCPU);
		jugar = (Button) findViewById(R.id.botonComenzarJuego);
		
		//Listener
		jugar.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {

		//Lanzamos la actividad que muestra el tablero
		Intent tableroIntent = new Intent(MainActivityTres.this, TableroActivity.class);
		tableroIntent.putExtra("vsCPU", vsCPU.isChecked());
		tableroIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
		startActivity(tableroIntent);
		//finish();
	}
	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main_activity_tres, menu);
		return true;
	}


}//fin activity
